﻿using System;

namespace Columbus
{
    /// <summary>
    /// Exception is thrown when view model can not be restored after deactivation
    /// </summary>
    public class ViewModelRestoringException : Exception
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ViewModelRestoringException"/> class.
        /// </summary>
        /// <param name="exception">Inner exception.</param>
        public ViewModelRestoringException(Exception exception)
            : base("Can not restore deactivated view model. Please note that restorable view model must either have default constructor or enough construction parameters persisted in view state during deactivation (construction parameters can be added to view state by overriding OnDeactivated method and adding construction parameters to view state by calling state.SaveConstructorParameter). Also see inner exception for more details", exception)
        {
        }
    }
}